//
//  UserEvaluateCell.m
//  CenturyCity
//
//  Created by beisheng03 on 2017/12/9.
//  Copyright © 2017年 beisheng. All rights reserved.
//

#import "UserEvaluateCell.h"

@interface UserEvaluateCell ()

@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
@property (weak, nonatomic) IBOutlet UILabel *nickNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
@property (weak, nonatomic) IBOutlet UILabel *leftLabel;
@property (weak, nonatomic) IBOutlet UILabel *rightLabel;

@end

@implementation UserEvaluateCell

- (void)awakeFromNib {
    
    [super awakeFromNib];
    
    self.iconImageView.layer.cornerRadius = 19;
    self.iconImageView.layer.masksToBounds = YES;
    
    self.nickNameLabel.font = MYFONT(16);
    
    self.contentLabel.font = MYFONT(14);
    
    self.leftLabel.font = MYFONT(17);
    
    self.rightLabel.font = MYFONT(17);
    
    self.leftLabel.layer.borderColor = darkGray.CGColor;
    self.leftLabel.layer.borderWidth = 0.6;
    self.leftLabel.layer.cornerRadius = 3;
    self.leftLabel.layer.masksToBounds = YES;
    self.leftLabel.textColor = darkGray;
    
    self.rightLabel.layer.borderColor = darkGray.CGColor;
    self.rightLabel.layer.borderWidth = 0.6;
    self.rightLabel.layer.cornerRadius = 3;
    self.rightLabel.layer.masksToBounds = YES;
    self.rightLabel.textColor = darkGray;
    
    self.contentLabel.attributedText = [self attributedString:@"这次购物很愉快!这次购物很愉快!这次购物很愉快!这次购物很愉快!这次购物很愉快!这次购物很愉快!这次购物很愉快!这次购物很愉快!这次购物很愉快!这次购物很愉快!这次购物很愉快!" withFont:MYFONT(14)];
    // Initialization code
}



- (NSAttributedString *)attributedString:(NSString *)str withFont:(UIFont *)font{
    
    NSMutableAttributedString *attr = [[NSMutableAttributedString alloc]initWithString:str];
    
    [attr addAttribute:NSFontAttributeName value:font range:NSMakeRange(0, str.length)];
    [attr addAttribute:NSForegroundColorAttributeName value:[UIColor blackColor] range:NSMakeRange(0, str.length)];
    [attr addAttribute:NSKernAttributeName value:@(1.0f) range:NSMakeRange(0, str.length)];
    
    NSMutableParagraphStyle *para = [[NSMutableParagraphStyle alloc]init];
    
    para.lineSpacing = 1;
    
    para.firstLineHeadIndent = 20;
    
    [attr addAttribute:NSParagraphStyleAttributeName value:para range:NSMakeRange(0, str.length)];
    
    
    return attr;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
